package com.example.demo5.servlet;

import com.example.demo4.Bean.Notice;
import com.example.demo4.dao.NoticeDao;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@WebServlet("/noticedetail.html")
public class NoticeDetailServlet extends HttpServlet {
    @Override
    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {
        String NoticeID = request.getParameter("NoticeID");
        int noticeID = Integer.parseInt(NoticeID);
        Notice notice = (new NoticeDao()).getNoticeByID(noticeID);
        request.setAttribute("title", notice.getNoticetitle());
        request.setAttribute("content", notice.getNoticecontent());
        request.getRequestDispatcher("front/newsFrontDetail.jsp").forward(request, response);
    }
}
